--------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/11_PaperFigures_log.txt
  log type:  text
 opened on:  25 Jun 2026, 13:00:27
r; t=0.00 13:00:27

. 
. include "_OutcomeLabels.do"

. /*==============================================================================
>   _OutcomeLabels.do  (helper, not run on its own)
> 
>   Defines polished, publication-ready labels for every outcome that appears
>   in figures and tables. Labels use the macro pattern `lbl_<outcome>`.
>   Visualization do files `include` this file and reference `lbl_<outcome>`
>   to print a pretty label rather than the raw Stata variable name.
> 
>   Categorical/binary indicators are suffixed with "[=1]" so the reader sees
>   what a unit change means; counts and continuous variables get explicit
>   units; standardized indices are flagged "(SD)".
> 
>   Sandra Rozo
> ==============================================================================*/
. 
. * ---- Economic well-being -----------------------------------------------------
. local lbl_jeea_index_wellbeing  "Well-being index (SD)"
r; t=0.00 13:00:27

. local lbl_labour_income         "Log monthly labor income"
r; t=0.00 13:00:27

. local lbl_gasto_capita          "Log per-capita HH consumption"
r; t=0.00 13:00:27

. local lbl_income_maxhh          "Log HH-max labor income"
r; t=0.00 13:00:27

. local lbl_employed              "Employed [=1]"
r; t=0.00 13:00:27

. 
. * ---- Labor ------------------------------------------------------------------
. local lbl_jeea_index_labor      "Labor index (SD)"
r; t=0.00 13:00:27

. local lbl_formal                "Formal employment [=1]"
r; t=0.00 13:00:27

. local lbl_hora_semana           "Log weekly hours (salaried)"
r; t=0.00 13:00:27

. 
. * ---- Services and rights ----------------------------------------------------
. local lbl_jeea_index_services   "Services index (SD)"
r; t=0.00 13:00:27

. local lbl_sisben                "SISBEN registration [=1]"
r; t=0.00 13:00:27

. local lbl_subs                  "Subsidized health [=1]"
r; t=0.00 13:00:27

. local lbl_bank                  "Savings account [=1]"
r; t=0.00 13:00:27

. local lbl_has_bank_account      "Bank account (incl. savings) [=1]"
r; t=0.00 13:00:27

. local lbl_govtr                 "Govt. transfers [=1]"
r; t=0.00 13:00:27

. 
. * ---- Health -----------------------------------------------------------------
. local lbl_health_pca            "Health PCA index (SD)"
r; t=0.00 13:00:27

. local lbl_anx_depr              "Severe anxiety/depression [=1]"
r; t=0.00 13:00:27

. local lbl_any_anx_depr          "Any anxiety/depression [=1]"
r; t=0.00 13:00:27

. local lbl_vas_score             "Self-rated health (0-100)"
r; t=0.00 13:00:27

. local lbl_phys_problem          "Physical health problem [=1]"
r; t=0.00 13:00:27

. local lbl_chronic_illness       "Chronic illness [=1]"
r; t=0.00 13:00:27

. local lbl_mh_index              "Mental-health composite (SD)"
r; t=0.00 13:00:27

. local lbl_life_satisfaction     "Life satisfaction (0-10)"
r; t=0.00 13:00:27

. local lbl_hi5_inv               "EQ-5D anx/depr (5-low to 1-high)"
r; t=0.00 13:00:27

. 
. * ---- Food security ----------------------------------------------------------
. local lbl_index_food            "Food security index (SD)"
r; t=0.00 13:00:27

. local lbl_skip_meals            "Skipped meals last month [=1]"
r; t=0.00 13:00:27

. local lbl_went_without_food     "Went without food [=1]"
r; t=0.00 13:00:27

. local lbl_protein_days          "Days w/ protein (last week)"
r; t=0.00 13:00:27

. local lbl_food_insecure_seek    "Sought food assistance [=1]"
r; t=0.00 13:00:27

. 
. * ---- Housing ----------------------------------------------------------------
. local lbl_index_housing         "Housing quality index (SD)"
r; t=0.00 13:00:27

. local lbl_adequate_housing      "Adequate housing [=1]"
r; t=0.00 13:00:27

. local lbl_has_electricity       "Has electricity [=1]"
r; t=0.00 13:00:27

. local lbl_has_water             "Has running water [=1]"
r; t=0.00 13:00:27

. local lbl_has_sewage            "Has sewage [=1]"
r; t=0.00 13:00:27

. 
. * ---- Integration ------------------------------------------------------------
. local lbl_index_integration     "Integration index (SD)"
r; t=0.00 13:00:27

. local lbl_belonging             "Sense of belonging (1-4)"
r; t=0.00 13:00:27

. local lbl_feel_integrated       "Feels integrated (1-4)"
r; t=0.00 13:00:27

. local lbl_trust_col             "Trust in Colombians (out-group, 1-5)"
r; t=0.00 13:00:27

. local lbl_trust_ven             "Trust in Venezuelans (in-group, 1-5)"
r; t=0.00 13:00:27

. local lbl_general_trust         "General trust in people (1-5)"
r; t=0.00 13:00:27

. local lbl_venezuelans_help_me   "Venezuelans help me (1-5)"
r; t=0.00 13:00:27

. local lbl_trust_index           "Prosocial behaviors composite (SD)"
r; t=0.00 13:00:27

. local lbl_col_friends           "Number Colombian friends"
r; t=0.00 13:00:27

. local lbl_community_org         "Belongs to community org [=1]"
r; t=0.00 13:00:27

. local lbl_connection_colombia   "Strong connection to Colombia [=1]"
r; t=0.00 13:00:27

. local lbl_colombians_help_me    "Colombians help me (1-5)"
r; t=0.00 13:00:27

. local lbl_count_on_col          "Can count on Colombians (1-5)"
r; t=0.00 13:00:27

. 
. * ---- Discrimination ---------------------------------------------------------
. local lbl_index_discrim         "Discrimination index (SD)"
r; t=0.00 13:00:27

. local lbl_discrim_ever          "Ever discriminated against [=1]"
r; t=0.00 13:00:27

. local lbl_discrim_freq          "Discrimination frequency (1-5)"
r; t=0.00 13:00:27

. local lbl_filed_complaint       "Filed discrimination complaint [=1]"
r; t=0.00 13:00:27

. 
. * ---- Migration intentions ---------------------------------------------------
. local lbl_intend_stay           "Intends to stay in Colombia [=1]"
r; t=0.00 13:00:27

. local lbl_plan_stay_5yr         "Plans to stay 5+ years [=1]"
r; t=0.00 13:00:27

. local lbl_considered_return_ven "Considered returning to Venezuela [=1]"
r; t=0.00 13:00:27

. 
. * ---- COVID -----------------------------------------------------------------
. local lbl_index_covid           "COVID resilience index (SD)"
r; t=0.00 13:00:27

. local lbl_covid_income_down     "Income fell during COVID [=1]"
r; t=0.00 13:00:27

. local lbl_covid_eviction        "Faced eviction during COVID [=1]"
r; t=0.00 13:00:27

. local lbl_covid_received_aid    "Received COVID aid [=1]"
r; t=0.00 13:00:27

. 
. * ---- Education -------------------------------------------------------------
. local lbl_currently_studying    "Currently studying [=1]"
r; t=0.00 13:00:27

. local lbl_currently_enrolled    "Currently enrolled in school [=1]"
r; t=0.00 13:00:27

. local lbl_degree_validated      "Foreign degree validated [=1]"
r; t=0.00 13:00:27

. 
. * ---- Children --------------------------------------------------------------
. local lbl_child_skip_meals      "Child skipped meals [=1]"
r; t=0.00 13:00:27

. local lbl_child_vaccinated      "Child vaccinated [=1]"
r; t=0.00 13:00:27

. local lbl_child_worked          "Child worked [=1]"
r; t=0.00 13:00:27

. 
. * ---- Remittances -----------------------------------------------------------
. local lbl_index_remit           "Remittances index (SD)"
r; t=0.00 13:00:27

. local lbl_remit_now             "Sends remittances now [=1]"
r; t=0.00 13:00:27

. local lbl_remit_to_parents      "Remits to parents [=1]"
r; t=0.00 13:00:27

. 
. * ---- Financial access and digital ------------------------------------------
. local lbl_index_fin_access      "Financial access index (SD)"
r; t=0.00 13:00:27

. local lbl_index_digital         "Digital access index (SD)"
r; t=0.00 13:00:27

. local lbl_has_savings_account   "Has savings account [=1]"
r; t=0.00 13:00:27

. local lbl_has_mobile_money      "Has mobile money [=1]"
r; t=0.00 13:00:27

. local lbl_has_smartphone        "Has smartphone [=1]"
r; t=0.00 13:00:27

. local lbl_has_internet          "Has internet [=1]"
r; t=0.00 13:00:27

. local lbl_apps_whatsapp         "Uses WhatsApp [=1]"
r; t=0.00 13:00:27

. 
. * ============================================================================
. *  PREDETERMINED COVARIATES (used for balance tests and as RD controls)
. * ============================================================================
. 
. * ---- Demographics ----------------------------------------------------------
. local lbl_female                "Female [=1]"
r; t=0.00 13:00:27

. local lbl_age_panel             "Age (years)"
r; t=0.00 13:00:27

. local lbl_yrseduc               "Years of education"
r; t=0.00 13:00:27

. local lbl_time_col              "Years in Colombia"
r; t=0.00 13:00:27

. local lbl_child_venez           "Has child born in Venezuela [=1]"
r; t=0.00 13:00:27

. 
. * ---- Pre-migration economic conditions (in Venezuela) ----------------------
. local lbl_jobopp                "Had a job offer in Colombia [=1]"
r; t=0.00 13:00:27

. local lbl_labven                "Worked in Venezuela [=1]"
r; t=0.00 13:00:27

. local lbl_typeworkven1          "Worked in agric./manual (VZ) [=1]"
r; t=0.00 13:00:27

. local lbl_typeworkven2          "Worked in services (VZ) [=1]"
r; t=0.00 13:00:27

. local lbl_typeworkven3          "Worked in skilled occ. (VZ) [=1]"
r; t=0.00 13:00:27

. local lbl_written_cont          "Had written contract (VZ) [=1]"
r; t=0.00 13:00:27

. local lbl_average               "Avg. days worked / week (VZ)"
r; t=0.00 13:00:27

. local lbl_smartven              "Owned smartphone in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_owner                 "Homeowner in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_electven              "Had electricity in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_waterven              "Had running water in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_sewageven             "Had sewage in VZ [=1]"
r; t=0.00 13:00:27

. 
. * ---- Family / migration network -------------------------------------------
. local lbl_hhven_parents         "Parents born in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_hhven_spouse          "Spouse born in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_hhven_other           "Other HH members born in VZ [=1]"
r; t=0.00 13:00:27

. local lbl_healthmig             "Healthy at migration [=1]"
r; t=0.00 13:00:27

. local lbl_frdfam                "Network in Colombia [=1]"
r; t=0.00 13:00:27

. r; t=0.01 13:00:27

. 
. * ----------------------------------------------------------------------------
. * PAPER COLOR PALETTE — colorblind-safe, print-safe via redundant encoding
. *   Wave 1 (2020, short-run)  : navy + hollow circles + solid line
. *   Wave 2 (2021, medium-run) : cranberry + filled squares + long-dash line
. *   Lee bounds robust         : forest green + solid bar
. *   Lee bounds crosses zero   : gs8 gray + dashed bar
. * In B&W navy prints ~30% gray and cranberry ~55% gray, so they remain
. * visually distinct even when color is stripped.
. * ----------------------------------------------------------------------------
. local W1col   "navy"
r; t=0.00 13:00:27

. local W2col   "cranberry"
r; t=0.00 13:00:27

. local W1fill  "navy%18"
r; t=0.00 13:00:27

. local W2fill  "cranberry%18"
r; t=0.00 13:00:27

. local LeeRob  "forest_green"
r; t=0.00 13:00:27

. local LeeAmb  "gs8"
r; t=0.00 13:00:27

. 
. di "=================================================================="
==================================================================
r; t=0.00 13:00:27

. di "  11_PaperFigures.do  —  $S_DATE  $S_TIME"
  11_PaperFigures.do  —  25 Jun 2026  13:00:27
r; t=0.00 13:00:27

. di "=================================================================="
==================================================================
r; t=0.00 13:00:27

. 
. /*==============================================================================
>   FIGURE 1 — First-stage discontinuity (W1+W2)
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:00:27

. di "--- Figure 1: first stage ---"
--- Figure 1: first stage ---
r; t=0.00 13:00:27

. 
. use "$clean/PEP_Analysis_Sample.dta", clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.13 13:00:27

. 
. local jeea_controls hhven_spouse hhven_other jobopp labven ///
>                     typeworkven1 typeworkven2 typeworkven3 ///
>                     written_cont average yrseduc healthmig frdfam ///
>                     smartven owner electven waterven sewageven female ///
>                     age_panel child_venez time_col
r; t=0.00 13:00:27

. 
. gen sample_roster = .
(13,580 missing values generated)
r; t=0.00 13:00:27

. qui reg trt_hh `jeea_controls'
r; t=2.44 13:00:30

. replace sample_roster = e(sample)
(13,580 real changes made)
r; t=0.00 13:00:30

. replace sample_roster = 0 if gasto_capita == . & trt_hh != .
(119 real changes made)
r; t=0.00 13:00:30

. replace sample_roster = 0 if employed == . & trt_hh != .
(88 real changes made)
r; t=0.00 13:00:30

. replace sample_roster = 0 if hora_semana == . & trt_hh != . & asalariado_num == 1
(64 real changes made)
r; t=0.00 13:00:30

. replace sample_roster = 0 if anx_depr == .
(2 real changes made)
r; t=0.00 13:00:30

. replace sample_roster = 0 if health_pca == .
(8 real changes made)
r; t=0.00 13:00:30

. bysort family_id: egen sample_reg = max(sample_roster)
r; t=0.02 13:00:30

. keep if (orden == 1 | orden == 2) & sample_reg == 1
(6,451 observations deleted)
r; t=0.02 13:00:30

. keep if abs(daterd) <= 206
(2,138 observations deleted)
r; t=0.01 13:00:30

. 
. * Build mental-health and trust composites on the fly (mirrors 07_RD_W1_W2.do)
. foreach src in life_satisfaction hi5_inv any_anx_depr vas_score general_trust trust_col trust_ven {
  2.     capture drop _z_`src'
  3.     gen _z_`src' = .
  4.     forvalues w = 1/2 {
  5.         qui sum `src' if pep == 0 & wave_num == `w'
  6.         if r(N) > 0 & r(sd) > 0 {
  7.             replace _z_`src' = (`src' - r(mean)) / r(sd) if wave_num == `w'
  8.         }
  9.     }
 10. }
(4,991 missing values generated)
(3,021 real changes made)
(1,962 real changes made)
(4,991 missing values generated)
(3,023 real changes made)
(1,964 real changes made)
(4,991 missing values generated)
(3,023 real changes made)
(1,964 real changes made)
(4,991 missing values generated)
(3,021 real changes made)
(1,962 real changes made)
(4,991 missing values generated)
(3,007 real changes made)
(1,881 real changes made)
(4,991 missing values generated)
(1,508 real changes made)
(965 real changes made)
(4,991 missing values generated)
(1,521 real changes made)
(971 real changes made)
r; t=0.03 13:00:30

. replace _z_any_anx_depr = -_z_any_anx_depr
(4,987 real changes made)
r; t=0.00 13:00:30

. egen mh_raw = rowmean(_z_life_satisfaction _z_hi5_inv _z_any_anx_depr _z_vas_score)
(4 missing values generated)
r; t=0.01 13:00:30

. egen trust_raw = rowmean(_z_general_trust _z_trust_col _z_trust_ven)
(96 missing values generated)
r; t=0.01 13:00:30

. 
. capture drop mh_index
r; t=0.00 13:00:30

. capture drop trust_index
r; t=0.00 13:00:30

. gen mh_index = .
(4,991 missing values generated)
r; t=0.00 13:00:30

. gen trust_index = .
(4,991 missing values generated)
r; t=0.00 13:00:30

. forvalues w = 1/2 {
  2.     qui sum mh_raw if pep == 0 & wave_num == `w'
  3.     if r(N) > 0 & r(sd) > 0 {
  4.         replace mh_index = (mh_raw - r(mean)) / r(sd) if wave_num == `w'
  5.     }
  6.     qui sum trust_raw if pep == 0 & wave_num == `w'
  7.     if r(N) > 0 & r(sd) > 0 {
  8.         replace trust_index = (trust_raw - r(mean)) / r(sd) if wave_num == `w'
  9.     }
 10. }
(3,023 real changes made)
(3,013 real changes made)
(1,964 real changes made)
(1,882 real changes made)
r; t=0.01 13:00:30

. drop _z_* mh_raw trust_raw
r; t=0.00 13:00:30

. 
. tempfile analysis
r; t=0.00 13:00:30

. save `analysis'
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000001.tmp saved as .dta format
r; t=0.07 13:00:30

. 
. * ---- Panel A: JEEA Figure 2A replication, in calendar-date units ----
. *  Weekly aggregation of PEP take-up (line, left axis) overlaid with the
. *  count of families per week (bars, right axis). W1 sample only.
. *  X-axis is the calendar date of arrival, matching JEEA's published figure.
. preserve
r; t=0.02 13:00:30

. keep if wave_num == 1
(1,968 observations deleted)
r; t=0.01 13:00:30

. 
. * McCrary density test on the running variable. Write the formatted
. * p-value to a small .tex file so the LaTeX caption can include it
. * without hard-coding (and stay editable outside Stata).
. capture rddensity date, c(0)
r; t=0.19 13:00:30

. local mc_p = e(pv_q)
r; t=0.00 13:00:30

. if "`mc_p'" == "" local mc_p = .
r; t=0.00 13:00:30

. local mc_p_fmt = string(`mc_p', "%5.3f")
r; t=0.00 13:00:30

. file open MCP using "$tex/tables/mccrary_pvalue.tex", write replace
r; t=0.01 13:00:30

. file write MCP "`mc_p_fmt'"
r; t=0.00 13:00:30

. file close MCP
r; t=0.00 13:00:30

. 
. * Convert running variable into a calendar arrival date.
. * daterd = arrival - June 8, 2018 (days). Reconstruct the Stata date.
. gen arrival_date = mdy(6,8,2018) + daterd
r; t=0.00 13:00:30

. format arrival_date %td
r; t=0.00 13:00:30

. 
. * Group by calendar week. JEEA's plot runs ~Jan 2017 to Dec 2018; we follow
. * that range and aggregate by week.
. gen week_id = floor((arrival_date - mdy(1,1,2017)) / 7)
r; t=0.00 13:00:30

. 
. * HH-level deduplication so each family contributes once to the weekly mean
. bysort family_id: egen pep_hh = mean(pep)
(10 missing values generated)
r; t=0.01 13:00:30

. bysort family_id: keep if _n == 1
(1,399 observations deleted)
r; t=0.01 13:00:30

. 
. * Collapse to one observation per calendar week (only weeks with data)
. gen one = 1
r; t=0.00 13:00:30

. collapse (mean) pep_hh (count) n_hh = one (min) wk_date = arrival_date, ///
>     by(week_id)
r; t=0.02 13:00:30

. format wk_date %td
r; t=0.00 13:00:30

. 
. * Trim to the actual data range so the x-axis doesn't waste space on empty
. * periods. Our analysis sample restricts |daterd| <= 206 days, so the data
. * span is roughly Nov 2017 -- Dec 2018.
. qui sum wk_date
r; t=0.00 13:00:30

. local x_min = r(min)
r; t=0.00 13:00:30

. local x_max = r(max)
r; t=0.00 13:00:30

. 
. gen eligible = (wk_date < mdy(6,8,2018))
r; t=0.00 13:00:30

. 
. local cutoff_d = mdy(6,8,2018)
r; t=0.00 13:00:30

. local nov17    = mdy(11,15,2017)
r; t=0.00 13:00:30

. local mar18    = mdy(3,1,2018)
r; t=0.00 13:00:30

. local sep18    = mdy(9,1,2018)
r; t=0.00 13:00:30

. local dec18    = mdy(12,31,2018)
r; t=0.00 13:00:30

. 
. twoway ///
>     (bar n_hh wk_date, yaxis(1) fcolor(gs10%50) lcolor(none) barw(7)) ///
>     (line pep_hh wk_date if eligible == 1, yaxis(2) lcolor(navy) lwidth(medthick)) ///
>     (line pep_hh wk_date if eligible == 0, yaxis(2) lcolor(navy) lwidth(medthick)) ///
>     , xline(`cutoff_d', lcolor(black) lpattern(shortdash) lwidth(medthin)) ///
>       title("(a) PEP-RAMV take-up by date of arrival", size(medsmall) color(black)) ///
>       xtitle("Date of arrival in Colombia", size(small)) ///
>       xlabel(`nov17' "Nov 2017" `mar18' "Mar 2018" `cutoff_d' "RAMV closes" `sep18' "Sep 2018" `dec18' "Dec 2018",
>  labsize(vsmall) nogrid notick) ///
>       ylabel(, axis(1) labsize(small) nogrid notick) ///
>       ytitle("Households per week", size(small) axis(1)) ///
>       ylabel(0(0.25)1, axis(2) labsize(small) nogrid notick) ///
>       ytitle("Pr(treatment)", size(small) axis(2)) ///
>       xscale(range(`x_min' `x_max') noline) ///
>       legend(order(2 "Pr(treatment) (right)" 1 "Households per week (left)") ///
>              rows(1) position(6) ring(1) ///
>              region(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>              size(small) symxsize(*0.7) keygap(*1.0) colgap(*1.5)) ///
>       graphregion(color(white) margin(small)) ///
>       plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>       bgcolor(white) ///
>       yscale(noline axis(1)) yscale(noline axis(2)) ///
>       name(fig1a, replace)
r; t=2.14 13:00:32

. restore
r; t=0.01 13:00:32

. 
. * Re-create the per-bin variables for Panels B and C
. preserve
r; t=0.02 13:00:32

. egen bin = cut(daterd), at(-210(20)210)
r; t=0.01 13:00:32

. bysort wave_num bin: egen pep_bin   = mean(pep)
r; t=0.01 13:00:32

. bysort wave_num bin: egen trt_bin   = mean(trt_hh)
r; t=0.01 13:00:32

. bysort wave_num bin: egen bin_xmean = mean(daterd)
r; t=0.00 13:00:32

. bysort wave_num bin: gen  first     = (_n == 1)
r; t=0.00 13:00:32

. 
. * ---- Panel B: individual PEP take-up (binned scatter, W1+W2 overlaid) ----
. twoway ///
>     (lfitci pep daterd if wave_num==1 & daterd<0,  level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid)   l
> width(medthick)) ///
>     (lfitci pep daterd if wave_num==1 & daterd>=0, level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid)   l
> width(medthick)) ///
>     (lfitci pep daterd if wave_num==2 & daterd<0,  level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longdash) 
> lwidth(medthick)) ///
>     (lfitci pep daterd if wave_num==2 & daterd>=0, level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longdash) 
> lwidth(medthick)) ///
>     (scatter pep_bin bin_xmean if wave_num==1 & first, msymbol(O) mcolor(`W1col') mfcolor(white)    msize(medlarge
> )) ///
>     (scatter pep_bin bin_xmean if wave_num==2 & first, msymbol(S) mcolor(`W2col') mfcolor(`W2col') msize(medlarge)
> ) ///
>     , xline(0, lcolor(black) lwidth(medthin)) ///
>       title("(b) Individual PEP take-up", size(medsmall) color(black)) ///
>       ytitle("Pr(individual has PEP-RAMV)", size(small)) ///
>       xtitle("Days to RAMV deadline", size(small)) ///
>       ylabel(0(0.25)1, nogrid notick labsize(small)) ///
>       xlabel(-200(100)200, nogrid notick labsize(small)) ///
>       legend(order(9 "Wave 1 (2020)" 10 "Wave 2 (2021)" 1 "95% CI") rows(1) position(6) ring(1) ///
>              region(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>              size(small) symxsize(*0.6) keygap(*1.0) colgap(*1.2)) ///
>       graphregion(color(white) margin(small)) ///
>       plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>       bgcolor(white) ///
>       yscale(noline) xscale(noline) ///
>       name(fig1b, replace)
r; t=0.87 13:00:33

. 
. * ---- Panel C: household PEP take-up (binned scatter, W1+W2 overlaid) ----
. twoway ///
>     (lfitci trt_hh daterd if wave_num==1 & daterd<0,  level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid) 
>   lwidth(medthick)) ///
>     (lfitci trt_hh daterd if wave_num==1 & daterd>=0, level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid) 
>   lwidth(medthick)) ///
>     (lfitci trt_hh daterd if wave_num==2 & daterd<0,  level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longdas
> h) lwidth(medthick)) ///
>     (lfitci trt_hh daterd if wave_num==2 & daterd>=0, level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longdas
> h) lwidth(medthick)) ///
>     (scatter trt_bin bin_xmean if wave_num==1 & first, msymbol(O) mcolor(`W1col') mfcolor(white)    msize(medlarge
> )) ///
>     (scatter trt_bin bin_xmean if wave_num==2 & first, msymbol(S) mcolor(`W2col') mfcolor(`W2col') msize(medlarge)
> ) ///
>     , xline(0, lcolor(black) lwidth(medthin)) ///
>       title("(c) Household PEP take-up", size(medsmall) color(black)) ///
>       ytitle("Pr(any HH member has PEP-RAMV)", size(small)) ///
>       xtitle("Days to RAMV deadline", size(small)) ///
>       ylabel(0(0.25)1, nogrid notick labsize(small)) ///
>       xlabel(-200(100)200, nogrid notick labsize(small)) ///
>       legend(order(9 "Wave 1 (2020)" 10 "Wave 2 (2021)" 1 "95% CI") rows(1) position(6) ring(1) ///
>              region(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>              size(small) symxsize(*0.6) keygap(*1.0) colgap(*1.2)) ///
>       graphregion(color(white) margin(small)) ///
>       plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>       bgcolor(white) ///
>       yscale(noline) xscale(noline) ///
>       name(fig1c, replace)
r; t=0.68 13:00:34

. 
. * ---- Body figure: 2 panels (a) date-of-arrival, (b) individual PEP take-up ----
. graph combine fig1a fig1b, ///
>     cols(1) rows(2) ///
>     graphregion(color(white) margin(small)) ///
>     ysize(9) xsize(8) ///
>     name(fig1_body, replace)
r; t=2.52 13:00:37

. graph export "$tfigs/fig1_first_stage.pdf", replace
file ../outputs/figures/fig1_first_stage.pdf saved as PDF format
r; t=0.20 13:00:37

. 
. * ---- Appendix figure: household PEP take-up (was panel (c) of body figure) ----
. graph display fig1c
r; t=0.31 13:00:37

. graph export "$tex/appendix/figures/fig1_first_stage_hh.pdf", replace
file ../outputs/appendix/figures/fig1_first_stage_hh.pdf saved as PDF format
r; t=0.19 13:00:37

. 
. graph drop fig1a fig1b fig1c fig1_body
r; t=0.44 13:00:38

. restore
r; t=0.01 13:00:38

. 
. di "  fig1_first_stage.pdf saved (body: panels a + b)"
  fig1_first_stage.pdf saved (body: panels a + b)
r; t=0.00 13:00:38

. di "  fig1_first_stage_hh.pdf saved (appendix: household first stage)"
  fig1_first_stage_hh.pdf saved (appendix: household first stage)
r; t=0.00 13:00:38

. 
. /*==============================================================================
>   FIGURE 2 — Pre-migration covariate balance coefplot (local continuity)
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:00:38

. di "--- Figure 2: covariate balance ---"
--- Figure 2: covariate balance ---
r; t=0.00 13:00:38

. 
. use `analysis', clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.04 13:00:38

. 
. * Figure 2 covariate set: matches the appendix balance table (B.1).
. * Excludes hhven_parents (parents born in VZ) per author note and
. * electven (had electricity in Venezuela) due to a coding problem with
. * the underlying variable.
. local pre_ctrls female age_panel yrseduc time_col jobopp labven           ///
>                 typeworkven1 typeworkven2 typeworkven3 written_cont        ///
>                 smartven owner waterven sewageven                          ///
>                 hhven_spouse hhven_other healthmig frdfam                  ///
>                 child_venez
r; t=0.00 13:00:38

. 
. * Standardize each covariate to mean 0 / SD 1 in the analysis sample
. foreach v of local pre_ctrls {
  2.     capture confirm variable `v'
  3.     if _rc continue
  4.     capture drop std_`v'
  5.     qui sum `v'
  6.     if r(sd) > 0 gen std_`v' = (`v' - r(mean)) / r(sd)
  7. }
(65 missing values generated)
(129 missing values generated)
(392 missing values generated)
(392 missing values generated)
(392 missing values generated)
(392 missing values generated)
r; t=0.06 13:00:38

. 
. * Run sharp RD on each standardized covariate, by wave
. local n_pre : word count `pre_ctrls'
r; t=0.00 13:00:38

. tempname BSTD
r; t=0.00 13:00:38

. matrix `BSTD' = J(`n_pre', 8, .)
r; t=0.00 13:00:38

. local i = 0
r; t=0.00 13:00:38

. local bstd_names ""
r; t=0.00 13:00:38

. foreach v of local pre_ctrls {
  2.     capture confirm variable std_`v'
  3.     if _rc continue
  4.     local ++i
  5.     local bstd_names "`bstd_names' `v'"
  6. 
.     capture rdrobust std_`v' date if wave_num == 1, c(0)
  7.     if !_rc {
  8.         matrix `BSTD'[`i', 1] = e(tau_bc)
  9.         matrix `BSTD'[`i', 2] = e(se_tau_rb)
 10.         matrix `BSTD'[`i', 3] = e(tau_bc) - 1.645*e(se_tau_rb)
 11.         matrix `BSTD'[`i', 4] = e(tau_bc) + 1.645*e(se_tau_rb)
 12.     }
 13.     capture rdrobust std_`v' date if wave_num == 2, c(0)
 14.     if !_rc {
 15.         matrix `BSTD'[`i', 5] = e(tau_bc)
 16.         matrix `BSTD'[`i', 6] = e(se_tau_rb)
 17.         matrix `BSTD'[`i', 7] = e(tau_bc) - 1.645*e(se_tau_rb)
 18.         matrix `BSTD'[`i', 8] = e(tau_bc) + 1.645*e(se_tau_rb)
 19.     }
 20. }
r; t=10.56 13:00:48

. matrix `BSTD' = `BSTD'[1..`i', 1...]
r; t=0.00 13:00:48

. local n_bstd = `i'
r; t=0.00 13:00:48

. 
. * Build a small dataset for the plot
. preserve
r; t=0.02 13:00:48

. clear
r; t=0.00 13:00:48

. set obs `n_bstd'
Number of observations (_N) was 0, now 19.
r; t=0.00 13:00:48

. gen str30 var = ""
(19 missing values generated)
r; t=0.00 13:00:48

. gen yorder = _n
r; t=0.00 13:00:48

. gen w1_b  = .
(19 missing values generated)
r; t=0.00 13:00:48

. gen w1_lb = .
(19 missing values generated)
r; t=0.00 13:00:48

. gen w1_ub = .
(19 missing values generated)
r; t=0.00 13:00:48

. gen w2_b  = .
(19 missing values generated)
r; t=0.00 13:00:48

. gen w2_lb = .
(19 missing values generated)
r; t=0.00 13:00:48

. gen w2_ub = .
(19 missing values generated)
r; t=0.00 13:00:48

. forvalues r = 1/`n_bstd' {
  2.     local nm : word `r' of `bstd_names'
  3.     replace var = "`nm'"        in `r'
  4.     replace w1_b   = `BSTD'[`r', 1] in `r'
  5.     replace w1_lb  = `BSTD'[`r', 3] in `r'
  6.     replace w1_ub  = `BSTD'[`r', 4] in `r'
  7.     replace w2_b   = `BSTD'[`r', 5] in `r'
  8.     replace w2_lb  = `BSTD'[`r', 7] in `r'
  9.     replace w2_ub  = `BSTD'[`r', 8] in `r'
 10. }
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
r; t=0.00 13:00:48

. 
. qui sum yorder
r; t=0.00 13:00:48

. local maxy = r(max)
r; t=0.00 13:00:48

. gen yrev = `maxy' - yorder + 1
r; t=0.00 13:00:48

. gen w1_y = yrev + 0.18
r; t=0.00 13:00:48

. gen w2_y = yrev - 0.18
r; t=0.00 13:00:48

. 
. local ylabel ""
r; t=0.00 13:00:48

. forvalues r = 1/`n_bstd' {
  2.     local nm   = var[`r']
  3.     local pos  = `n_bstd' - `r' + 1
  4.     local pretty "`lbl_`nm''"
  5.     if "`pretty'" == "" local pretty "`nm'"
  6.     local ylabel `"`ylabel' `pos' "`pretty'""'
  7. }
r; t=0.00 13:00:48

. 
. * Light horizontal guide lines between covariates for readability
. local guide_rows ""
r; t=0.00 13:00:48

. forvalues r = 1/`=`n_bstd'-1' {
  2.     local guide_rows "`guide_rows' yline(`=`n_bstd'-`r'+0.5', lcolor(gs15) lwidth(vthin))"
  3. }
r; t=0.00 13:00:48

. 
. * Two-color palette: navy for Wave 1, cranberry for Wave 2
. twoway ///
>     (rcap w1_lb w1_ub w1_y if !missing(w1_b), horizontal lcolor(navy) lwidth(medthin)) ///
>     (rcap w2_lb w2_ub w2_y if !missing(w2_b), horizontal lcolor(cranberry) lwidth(medthin)) ///
>     (scatter w1_y w1_b if !missing(w1_b), msymbol(O) mlcolor(navy) mfcolor(white) mlwidth(medium) msize(medium)) /
> //
>     (scatter w2_y w2_b if !missing(w2_b), msymbol(S) mlcolor(cranberry) mfcolor(cranberry) mlwidth(medium) msize(m
> edium)) ///
>     , xline(0, lcolor(black) lpattern(solid) lwidth(thin)) ///
>       `guide_rows' ///
>       ylabel(`ylabel', labsize(small) angle(0) nogrid notick) ///
>       yscale(noline) ///
>       xlabel(, labsize(small) nogrid notick) ///
>       xscale(noline) ///
>       ytitle("") ///
>       xtitle("Sharp RD coefficient at the cutoff (SD units)", size(small) margin(medsmall)) ///
>       legend(order(3 "Wave 1 (2020)" 4 "Wave 2 (2021)" 1 "90% CI (Wave 1)" 2 "90% CI (Wave 2)") ///
>              rows(2) cols(2) position(6) ring(1) ///
>              region(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>              size(small) symxsize(*0.6) keygap(*1.0) colgap(*1.4) bmargin(small)) ///
>       graphregion(color(white) margin(medium)) ///
>       plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(medium)) ///
>       bgcolor(white) ///
>       ysize(8) xsize(9) ///
>       name(fig2_balance, replace)
r; t=1.74 13:00:50

. 
. graph export "$tfigs/fig2_balance.pdf", replace
file ../outputs/figures/fig2_balance.pdf saved as PDF format
r; t=0.22 13:00:50

. graph drop fig2_balance
r; t=0.09 13:00:50

. restore
r; t=0.00 13:00:50

. 
. di "  fig2_balance.pdf saved"
  fig2_balance.pdf saved
r; t=0.00 13:00:50

. 
. /*==============================================================================
>   FIGURE 3 — 2x2 RD plots for 4 anchor outcomes
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:00:50

. di "--- Figure 3: 2x2 RD plots ---"
--- Figure 3: 2x2 RD plots ---
r; t=0.00 13:00:50

. 
. use `analysis', clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.04 13:00:50

. egen bin = cut(daterd), at(-210(10)210)
r; t=0.02 13:00:50

. 
. local anchor_vars  jeea_index_wellbeing jeea_index_services jeea_index_labor index_integration trust_index index_f
> ood index_housing
r; t=0.00 13:00:50

. local anchor_ttl1  "Well-being index (SD)"
r; t=0.00 13:00:50

. local anchor_ttl2  "Services index (SD)"
r; t=0.00 13:00:50

. local anchor_ttl3  "Labor index (SD)"
r; t=0.00 13:00:50

. local anchor_ttl4  "Integration index (SD)"
r; t=0.00 13:00:50

. local anchor_ttl5  "Prosocial behaviors composite (SD)"
r; t=0.00 13:00:50

. local anchor_ttl6  "Food security index (SD)"
r; t=0.00 13:00:50

. local anchor_ttl7  "Housing quality index (SD)"
r; t=0.00 13:00:50

. 
. forvalues k = 1/7 {
  2.     local v   : word `k' of `anchor_vars'
  3.     local ttl "`anchor_ttl`k''"
  4. 
.     capture drop var_bin bin_xmean first
  5.     bysort wave_num bin: egen var_bin   = mean(`v')
  6.     bysort wave_num bin: egen bin_xmean = mean(daterd)
  7.     bysort wave_num bin: gen  first     = (_n == 1)
  8. 
.     * Per-panel y-axis range.  Default uses min/max of all bin means within
.     * +/-200 days padded by 0.1.  Integration, prosocial, food and housing
.     * have flatter outside-cutoff slopes -- zoom them tighter (window
.     * +/-60 days, padding 0.05) so the local jump fills more of the panel.
.     local zoom_extra = 0
  9.     foreach zv in index_integration trust_index index_food index_housing {
 10.         if "`v'" == "`zv'" local zoom_extra = 1
 11.     }
 12.     if `zoom_extra' {
 13.         qui sum var_bin if first & abs(daterd)<=60
 14.         local y_lo = r(min) - 0.05
 15.         local y_hi = r(max) + 0.05
 16.     }
 17.     else {
 18.         qui sum var_bin if first & abs(daterd)<=200
 19.         local y_lo = r(min) - 0.1
 20.         local y_hi = r(max) + 0.1
 21.     }
 22.     if "`y_lo'" == "." | "`y_hi'" == "." {
 23.         local y_range
 24.     }
 25.     else if `zoom_extra' {
 26.         * Tight panels (integration, prosocial, food, housing): snap to
.         * 0.25 increments, label every 0.25, two decimals.  Keeps the
.         * zoomed range from being inflated by 0.5 snapping.
.         local y_lab_lo = floor(`y_lo' * 4) / 4
 27.         local y_lab_hi = ceil(`y_hi' * 4) / 4
 28.         local y_range ylabel(`y_lab_lo'(0.25)`y_lab_hi', nogrid notick labsize(vsmall) format(%4.2f)) ///
>                       yscale(range(`y_lab_lo' `y_lab_hi'))
 29.     }
 30.     else {
 31.         * Default panels: snap to 0.5, label every 0.5, one decimal.
.         local y_lab_lo = floor(`y_lo' * 2) / 2
 32.         local y_lab_hi = ceil(`y_hi' * 2) / 2
 33.         local y_range ylabel(`y_lab_lo'(0.5)`y_lab_hi', nogrid notick labsize(vsmall) format(%3.1f)) ///
>                       yscale(range(`y_lab_lo' `y_lab_hi'))
 34.     }
 35. 
.     twoway ///
>         (lfitci `v' daterd if wave_num==1 & daterd<0,  level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid)
>    lwidth(medthick)) ///
>         (lfitci `v' daterd if wave_num==1 & daterd>=0, level(95) lcolor(`W1col') acolor(`W1fill') alpattern(solid)
>    lwidth(medthick)) ///
>         (lfitci `v' daterd if wave_num==2 & daterd<0,  level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longda
> sh) lwidth(medthick)) ///
>         (lfitci `v' daterd if wave_num==2 & daterd>=0, level(95) lcolor(`W2col') acolor(`W2fill') alpattern(longda
> sh) lwidth(medthick)) ///
>         (scatter var_bin bin_xmean if wave_num==1 & first, msymbol(O) mcolor(`W1col') mfcolor(white)    msize(smal
> l)) ///
>         (scatter var_bin bin_xmean if wave_num==2 & first, msymbol(S) mcolor(`W2col') mfcolor(`W2col') msize(small
> )) ///
>         , xline(0, lcolor(black) lwidth(medthin)) ///
>           title("`ttl'", size(medsmall) color(black)) ///
>           ytitle("") ///
>           xtitle("Days to deadline", size(vsmall)) ///
>           xlabel(-200(100)200, nogrid notick labsize(vsmall)) ///
>           `y_range' ///
>           legend(off) ///
>           graphregion(color(white) margin(small)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           yscale(noline) xscale(noline) ///
>           name(fig2_`k', replace)
 36. }
r; t=8.17 13:00:59

. 
. * Stand-alone legend tile that occupies the 8th cell of the 3x3 grid.
. * Plots phantom points (off-screen) just to render legend keys for the
. * line and marker types that appear in the panels above.
. twoway ///
>     (scatteri 0 -1000, msymbol(O) mcolor(`W1col') mfcolor(white)    msize(medlarge)) ///
>     (scatteri 0 -1000, msymbol(S) mcolor(`W2col') mfcolor(`W2col') msize(medlarge)) ///
>     (function y = ., range(-1 1) lcolor(`W1col') lpattern(solid)   lwidth(medthick)) ///
>     (function y = ., range(-1 1) lcolor(`W2col') lpattern(longdash) lwidth(medthick)) ///
>     (function y = ., range(-1 1) lcolor(`W1fill') lwidth(thick)) ///
>     , legend(order(1 "Wave 1 (2020) bin mean" 2 "Wave 2 (2021) bin mean" ///
>                    3 "Wave 1 linear fit"      4 "Wave 2 linear fit" ///
>                    5 "95% CI band") ///
>              rows(5) position(0) ring(0) ///
>              region(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>              size(small) symxsize(*0.7) keygap(*1.0) colgap(*1.0) bmargin(small)) ///
>       ylabel(none) xlabel(none) ///
>       yscale(off range(0 1)) xscale(off range(0 1)) ///
>       ytitle("") xtitle("") ///
>       title("", size(zero)) ///
>       graphregion(color(white) margin(zero)) ///
>       plotregion(fcolor(white) lcolor(white) margin(zero)) ///
>       bgcolor(white) ///
>       name(fig2_legend, replace)
r; t=0.77 13:00:59

. 
. graph combine fig2_1 fig2_2 fig2_3 fig2_4 fig2_5 fig2_6 fig2_7 fig2_legend, ///
>     cols(3) rows(3) ///
>     graphregion(color(white) margin(small)) ///
>     title("", size(zero)) ///
>     ysize(9) xsize(11) ///
>     name(fig2_combined, replace)
r; t=10.05 13:01:09

. graph export "$tfigs/fig3_rd_headline.pdf", replace
file ../outputs/figures/fig3_rd_headline.pdf saved as PDF format
r; t=0.24 13:01:10

. graph drop fig2_1 fig2_2 fig2_3 fig2_4 fig2_5 fig2_6 fig2_7 fig2_legend fig2_combined
r; t=0.67 13:01:10

. 
. di "  fig3_rd_headline.pdf saved (7 thematic panels)"
  fig3_rd_headline.pdf saved (7 thematic panels)
r; t=0.00 13:01:10

. 
. 
. /*==============================================================================
>   FIGURE 5 — Compact Lee bounds, W2 headline outcomes
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:01:10

. di "--- Figure 5: Lee bounds compact ---"
--- Figure 5: Lee bounds compact ---
r; t=0.00 13:01:10

. 
. import delimited "$out/08_LeeBounds_W2_results.txt", clear delimiter(tab) ///
>     varnames(1) stringcols(1 2)
(encoding automatically selected: ISO-8859-1)
(7 vars, 45 obs)
r; t=0.13 13:01:11

. destring point lower upper trim_q n_eff, replace force
point already numeric; no replace
lower already numeric; no replace
upper already numeric; no replace
trim_q already numeric; no replace
n_eff already numeric; no replace
r; t=0.00 13:01:11

. 
. * Robust = both bounds same sign as point
. gen robust = (lower > 0 & upper > 0) | (lower < 0 & upper < 0) ///
>     if !missing(lower, upper)
r; t=0.00 13:01:11

. 
. tempfile lee_all
r; t=0.00 13:01:11

. save `lee_all'
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000005.tmp saved as .dta format
r; t=0.01 13:01:11

. 
. * Seven thematic panels (Lee bounds): well-being, services, labor,
. * integration, prosocial behaviors, food, housing.
. local theme1_vars  jeea_index_wellbeing labour_income gasto_capita health_pca
r; t=0.00 13:01:11

. local theme2_vars  jeea_index_services sisben subs govtr
r; t=0.00 13:01:11

. local theme3_vars  jeea_index_labor labour_income employed formal hora_semana
r; t=0.00 13:01:11

. local theme4_vars  index_integration belonging feel_integrated col_friends community_org connection_colombia
r; t=0.00 13:01:11

. local theme5_vars  trust_index general_trust trust_col trust_ven
r; t=0.00 13:01:11

. local theme6_vars  index_food skip_meals went_without_food protein_days
r; t=0.00 13:01:11

. local theme7_vars  index_housing adequate_housing has_electricity has_water has_sewage
r; t=0.00 13:01:11

. 
. local theme1_ttl  "(a) Well-being"
r; t=0.00 13:01:11

. local theme2_ttl  "(b) Services and rights"
r; t=0.00 13:01:11

. local theme3_ttl  "(c) Labor market"
r; t=0.00 13:01:11

. local theme4_ttl  "(d) Integration"
r; t=0.00 13:01:11

. local theme5_ttl  "(e) Prosocial behaviors"
r; t=0.00 13:01:11

. local theme6_ttl  "(f) Food security"
r; t=0.00 13:01:11

. local theme7_ttl  "(g) Housing quality"
r; t=0.00 13:01:11

. 
. forvalues k = 1/7 {
  2.     local outvars `theme`k'_vars'
  3.     local ttl     "`theme`k'_ttl'"
  4. 
.     use `lee_all', clear
  5.     gen ord = .
  6.     local ic = 0
  7.     foreach v of local outvars {
  8.         local ++ic
  9.         replace ord = `ic' if outcome == "`v'"
 10.     }
 11.     keep if !missing(ord)
 12.     sort ord
 13.     gen yorder = _N - _n + 1
 14. 
.     local ylabel ""
 15.     forvalues r = 1/`=_N' {
 16.         local nm     = outcome[`r']
 17.         local pos    = _N - `r' + 1
 18.         local pretty "`lbl_`nm''"
 19.         if "`pretty'" == "" local pretty "`nm'"
 20.         local ylabel `"`ylabel' `pos' "`pretty'""'
 21.     }
 22. 
.     twoway ///
>         (rspike lower upper yorder if robust == 1, horizontal lcolor(`LeeRob') lwidth(thick)) ///
>         (rspike lower upper yorder if robust != 1, horizontal lcolor(`LeeAmb') lwidth(medthick) lpattern(dash)) //
> /
>         (scatter yorder point, msymbol(O) mcolor(black) mfcolor(white) msize(small)) ///
>         , xline(0, lcolor(gs8) lpattern(solid) lwidth(thin)) ///
>           ylabel(`ylabel', labsize(vsmall) angle(0) nogrid notick) ///
>           yscale(noline) ///
>           xlabel(, labsize(vsmall) nogrid notick) ///
>           xscale(noline) ///
>           ytitle("") ///
>           xtitle("W2 RD coefficient + Lee bounds", size(vsmall) margin(small)) ///
>           title("`ttl'", size(medium) color(black)) ///
>           legend(off) ///
>           graphregion(color(white) margin(medlarge)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           name(lee_`k', replace)
 23. }
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(41 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(41 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(40 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(39 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(41 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(41 observations deleted)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(40 observations deleted)
r; t=3.100 13:01:15

. 
. * Panel 8 = legend-only cell (sits next to panel 7 in the 3x3 layout).
. * Plot the same series on a single observation; suppress all axes; only
. * the legend itself is visible.
. preserve
r; t=0.00 13:01:15

. keep if outcome == "jeea_index_wellbeing"
(5 observations deleted)
r; t=0.00 13:01:15

. twoway ///
>     (rspike lower upper point, horizontal lcolor(`LeeRob') lwidth(thick)) ///
>     (rspike lower upper point, horizontal lcolor(`LeeAmb') lwidth(medthick) lpattern(dash)) ///
>     (scatter point point, msymbol(O) mcolor(black) mfcolor(white) msize(small)) ///
>     , legend(order(1 "Bounds robust to attrition" 2 "Bounds straddle zero" 3 "Point estimate") cols(1) position(0)
>  ring(0) region(fcolor(white) lcolor(white)) size(medium) symxsize(*1.0) keygap(*1.2) rowgap(*1.5)) ///
>       xtitle("") ytitle("") title("") ///
>       xscale(off) yscale(off) ///
>       xlabel("") ylabel("") ///
>       graphregion(color(white) margin(small) lstyle(none)) ///
>       plotregion(fcolor(white) lcolor(white) lwidth(none)) ///
>       bgcolor(white) ///
>       name(lee_legend, replace)
r; t=0.44 13:01:15

. restore
r; t=0.00 13:01:15

. 
. graph combine lee_1 lee_2 lee_3 lee_4 lee_5 lee_6 lee_7 lee_legend, ///
>     cols(4) rows(2) ///
>     graphregion(color(white) margin(small)) ///
>     ysize(7) xsize(14) ///
>     name(fig_lee_combined, replace)
r; t=7.50 13:01:22

. graph export "$tfigs/fig5_leebounds.pdf", replace
file ../outputs/figures/fig5_leebounds.pdf saved as PDF format
r; t=0.19 13:01:23

. graph drop lee_1 lee_2 lee_3 lee_4 lee_5 lee_6 lee_7 lee_legend fig_lee_combined
r; t=0.50 13:01:23

. 
. di "  fig5_leebounds.pdf saved (7 thematic panels)"
  fig5_leebounds.pdf saved (7 thematic panels)
r; t=0.00 13:01:23

. 
. /*==============================================================================
>   FIGURE 7 — Continuous bandwidth sweep
>               7 panels (main indices) x W1+W2 overlay.
>               Each panel: x-axis = bandwidth in days, y-axis = fuzzy-RD coef
>               with 90% CI bands.
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:01:23

. di "--- Figure 7: bandwidth sweep ---"
--- Figure 7: bandwidth sweep ---
r; t=0.00 13:01:23

. 
. use `analysis', clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.05 13:01:23

. 
. local jeea_for_rd  hhven_spouse hhven_other jobopp labven typeworkven1 ///
>                    typeworkven2 typeworkven3 written_cont average yrseduc ///
>                    healthmig frdfam smartven owner electven waterven ///
>                    sewageven female age_panel child_venez time_col
r; t=0.00 13:01:23

. 
. local sweep_outcomes  jeea_index_wellbeing jeea_index_services jeea_index_labor ///
>                       index_integration trust_index index_food index_housing
r; t=0.00 13:01:23

. local sweep_titles1   "Well-being"
r; t=0.00 13:01:23

. local sweep_titles2   "Services"
r; t=0.00 13:01:23

. local sweep_titles3   "Labor"
r; t=0.00 13:01:23

. local sweep_titles4   "Integration"
r; t=0.00 13:01:23

. local sweep_titles5   "Prosocial"
r; t=0.00 13:01:23

. local sweep_titles6   "Food security"
r; t=0.00 13:01:23

. local sweep_titles7   "Housing"
r; t=0.00 13:01:23

. 
. * Bandwidth grid in days (20-day ad-hoc, JEEA convention)
. local bw_grid 30 50 70 90 110 130 150 170 190
r; t=0.00 13:01:23

. local n_bw : word count `bw_grid'
r; t=0.00 13:01:23

. 
. * Pre-allocate a dataset to hold one row per (outcome, wave, bandwidth)
. preserve
r; t=0.02 13:01:23

. clear
r; t=0.00 13:01:23

. gen str40 outcome   = ""
r; t=0.00 13:01:23

. gen byte  wave_num  = .
r; t=0.00 13:01:23

. gen int   h_days    = .
r; t=0.00 13:01:23

. gen double coef     = .
r; t=0.00 13:01:23

. gen double se       = .
r; t=0.00 13:01:23

. tempfile sweepres
r; t=0.00 13:01:23

. save `sweepres', emptyok
(dataset contains 0 observations)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
r; t=0.00 13:01:23

. restore
r; t=0.01 13:01:23

. 
. forvalues k = 1/7 {
  2.     local v : word `k' of `sweep_outcomes'
  3.     forvalues w = 1/2 {
  4.         foreach h of local bw_grid {
  5.             capture qui rdrobust `v' date if wave_num == `w', ///
>                 c(0) p(1) kernel(triangular) fuzzy(pep) h(`h' `h')
  6.             if !_rc & e(tau_bc) != . {
  7.                 local b  = e(tau_bc)
  8.                 local s  = e(se_tau_rb)
  9.                 preserve
 10.                 use `sweepres', clear
 11.                 local nrow = _N + 1
 12.                 set obs `nrow'
 13.                 replace outcome  = "`v'" in `nrow'
 14.                 replace wave_num = `w'   in `nrow'
 15.                 replace h_days   = `h'   in `nrow'
 16.                 replace coef     = `b'   in `nrow'
 17.                 replace se       = `s'   in `nrow'
 18.                 save `sweepres', replace
 19.                 restore
 20.             }
 21.         }
 22.     }
 23. }
Number of observations (_N) was 0, now 1.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 1, now 2.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 2, now 3.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 3, now 4.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 4, now 5.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 5, now 6.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 6, now 7.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 7, now 8.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 8, now 9.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 9, now 10.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 10, now 11.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 11, now 12.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 12, now 13.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 13, now 14.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 14, now 15.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 15, now 16.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 16, now 17.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 17, now 18.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 18, now 19.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 19, now 20.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 20, now 21.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 21, now 22.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 22, now 23.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 23, now 24.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 24, now 25.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 25, now 26.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 26, now 27.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 27, now 28.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 28, now 29.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 29, now 30.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 30, now 31.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 31, now 32.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 32, now 33.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 33, now 34.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 34, now 35.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 35, now 36.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 36, now 37.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 37, now 38.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 38, now 39.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 39, now 40.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 40, now 41.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 41, now 42.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 42, now 43.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 43, now 44.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 44, now 45.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 45, now 46.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 46, now 47.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 47, now 48.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 48, now 49.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 49, now 50.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 50, now 51.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 51, now 52.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 52, now 53.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 53, now 54.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 54, now 55.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 55, now 56.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 56, now 57.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 57, now 58.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 58, now 59.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 59, now 60.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 60, now 61.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 61, now 62.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 62, now 63.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 63, now 64.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 64, now 65.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 65, now 66.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 66, now 67.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 67, now 68.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 68, now 69.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 69, now 70.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 70, now 71.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 71, now 72.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 72, now 73.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 73, now 74.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 74, now 75.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 75, now 76.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 76, now 77.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 77, now 78.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 78, now 79.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 79, now 80.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 80, now 81.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 81, now 82.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 82, now 83.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 83, now 84.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 84, now 85.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 85, now 86.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 86, now 87.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 87, now 88.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 88, now 89.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 89, now 90.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 90, now 91.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 91, now 92.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 92, now 93.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 93, now 94.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 94, now 95.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 95, now 96.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 96, now 97.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 97, now 98.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 98, now 99.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 99, now 100.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 100, now 101.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 101, now 102.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 102, now 103.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 103, now 104.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 104, now 105.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 105, now 106.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 106, now 107.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 107, now 108.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 108, now 109.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 109, now 110.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 110, now 111.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 111, now 112.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 112, now 113.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 113, now 114.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 114, now 115.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 115, now 116.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 116, now 117.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 117, now 118.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 118, now 119.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 119, now 120.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 120, now 121.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 121, now 122.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 122, now 123.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 123, now 124.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 124, now 125.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
Number of observations (_N) was 125, now 126.
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000008.tmp saved as .dta format
r; t=32.58 13:01:56

. 
. use `sweepres', clear
r; t=0.01 13:01:56

. gen lb = coef - 1.645 * se
r; t=0.00 13:01:56

. gen ub = coef + 1.645 * se
r; t=0.00 13:01:56

. 
. forvalues k = 1/7 {
  2.     local v   : word `k' of `sweep_outcomes'
  3.     local ttl "`sweep_titles`k''"
  4. 
.     * Force y-axis to include zero so the reference line is always visible.
.     qui sum lb if outcome == "`v'"
  5.     local y_lo = min(r(min), 0) - 0.1
  6.     qui sum ub if outcome == "`v'"
  7.     local y_hi = max(r(max), 0) + 0.1
  8. 
.     twoway ///
>         (rarea lb ub h_days if outcome == "`v'" & wave_num == 1, color(`W1fill') lcolor(%0)) ///
>         (line coef h_days if outcome == "`v'" & wave_num == 1, lcolor(`W1col') lpattern(solid) lwidth(medthick)) /
> //
>         (rarea lb ub h_days if outcome == "`v'" & wave_num == 2, color(`W2fill') lcolor(%0)) ///
>         (line coef h_days if outcome == "`v'" & wave_num == 2, lcolor(`W2col') lpattern(longdash) lwidth(medthick)
> ) ///
>         , yline(0, lcolor(gs8) lpattern(solid) lwidth(thin)) ///
>           xlabel(30(40)190, labsize(small) nogrid notick) ///
>           xscale(noline) ///
>           ylabel(, labsize(small) nogrid notick) ///
>           yscale(noline range(`y_lo' `y_hi')) ///
>           xtitle("Bandwidth (days)", size(small)) ///
>           ytitle("") ///
>           title("`ttl'", size(large) color(black)) ///
>           legend(off) ///
>           graphregion(color(white) margin(small)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           name(fig7_`k', replace)
  9. }
r; t=4.35 13:02:00

. 
. * Panel 8 = legend-only cell (sits to the right of panel 7 in 4x2 layout).
. * Plot the same series with a single observation each; suppress all axes;
. * the only visible content is the legend itself.
. preserve
r; t=0.00 13:02:00

. keep if outcome == "`: word 1 of `sweep_outcomes''" & wave_num == 1 & h_days == 30
(125 observations deleted)
r; t=0.00 13:02:00

. twoway ///
>     (rarea lb ub h_days, color(`W1fill') lcolor(%0)) ///
>     (line  coef h_days, lcolor(`W1col') lpattern(solid) lwidth(medthick)) ///
>     (rarea lb ub h_days, color(`W2fill') lcolor(%0)) ///
>     (line  coef h_days, lcolor(`W2col') lpattern(longdash) lwidth(medthick)) ///
>     , legend(order(2 "Wave 1 (2020)" 4 "Wave 2 (2021)" 1 "90\% CI") cols(1) position(0) ring(0) region(fcolor(whit
> e) lcolor(white)) size(large) symxsize(*1.0) keygap(*1.2) rowgap(*1.5)) ///
>       xtitle("") ytitle("") title("") ///
>       xscale(off) yscale(off) ///
>       xlabel("") ylabel("") ///
>       graphregion(color(white) margin(small) lstyle(none)) ///
>       plotregion(fcolor(white) lcolor(white) lwidth(none)) ///
>       bgcolor(white) ///
>       name(fig7_legend, replace)
r; t=0.46 13:02:01

. restore
r; t=0.00 13:02:01

. 
. graph combine fig7_1 fig7_2 fig7_3 fig7_4 fig7_5 fig7_6 fig7_7 fig7_legend, ///
>     cols(4) rows(2) ///
>     graphregion(color(white) margin(small)) ///
>     ysize(7) xsize(12) ///
>     name(fig7_combined, replace)
r; t=8.08 13:02:09

. graph export "$tfigs/fig7_bw_sweep.pdf", replace
file ../outputs/figures/fig7_bw_sweep.pdf saved as PDF format
r; t=0.21 13:02:09

. graph drop fig7_1 fig7_2 fig7_3 fig7_4 fig7_5 fig7_6 fig7_7 fig7_legend fig7_combined
r; t=0.49 13:02:09

. 
. di "  fig7_bw_sweep.pdf saved (continuous bandwidth sweep)"
  fig7_bw_sweep.pdf saved (continuous bandwidth sweep)
r; t=0.00 13:02:09

. 
. /*==============================================================================
>   DONE
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:02:09

. di "=================================================================="
==================================================================
r; t=0.00 13:02:09

. di "  All paper figures saved to $tfigs/"
  All paper figures saved to ../outputs/figures/
r; t=0.00 13:02:09

. di "=================================================================="
==================================================================
r; t=0.00 13:02:09

. 
. log close
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/11_PaperFigures_log.txt
  log type:  text
 closed on:  25 Jun 2026, 13:02:09
--------------------------------------------------------------------------------------------------------------------
